<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<style>
td {
      white-space:nowrap;overflow:hidden;text-overflow: ellipsis;
}

</style>
<link rel="stylesheet" href="__PUBLIC__/Admin/css/pintuer.css">
<link rel="stylesheet" href="__PUBLIC__/Admin/css/admin.css">
<script src="__PUBLIC__/Admin/js/jquery.js"></script>
<script src="__PUBLIC__/Admin/js/pintuer.js"></script>
</head>
<body>
<form method="post" action="" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 房源列表</strong> <a href="" style="float:right; display:none;"></a></div>
    <table class="table table-hover text-center">
      <tr>
        <th  style="text-align:left;width:3%; padding-left:20px;">序号</th>
        <th style="width:5%;" >发布人</th>
        <th style="width:7%;">小区名称</th>
        <th style="width:10%;">标题</th>
        <th style="width:8%;">户型</th>
        <th style="width:5%;">建筑面积（m²）</th>
        <th style="width:7%;">价格(元)</th>
        <th style="width:10%;">房源图片</th>
        <th style="width:13%;">位置</th>
        <th style="width:12%;">添加时间</th>
        <th style="width:15%;">操作</th>
      </tr>
      <volist name="info" id="v">
        <tr height='1'>
          <td style="text-align:left; padding-left:20px;height:20px;">
           {$v.sorce}</td>
           <td>{$v.uid}</td>
          <td title="{$v.name}">{$v.name}</td>
          <td title="{$v.note}">{$v.note}</td>
          <td><font color="#00CC99">{$v.huxing}</font></td>
          <td>{$v.mianji}</td>
          <td><font color="#00CC99">{$v.price}</font></td>
           <td ><img src="__PUBLIC__/Upload/{$v.pic}" alt="" width="70" height="50" /></td>
          <td>{$v.address}</td>
          <td>{$v.ctime}</td>
          <td><div class="button-group"> <a class="button border-main" href="__CONTROLLER__/houseEdite?id={$v.id}"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="javascript:void(0)" onclick="return del({$v.id})"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
        </volist>
      <!-- <tr>
        <td colspan="8"><div class="pagelist"> <a href="">上一页</a> <span class="current">1</span><a href="">2</a><a href="">3</a><a href="">下一页</a><a href="">尾页</a> </div></td>
      </tr> -->
    </table>
  </div>
</form>
<script type="text/javascript">
//单个删除
function del(id){
	if(confirm("您确定要删除吗?")){
    $.ajax({
      url: '__CONTROLLER__/houseDel',
      type: 'POST',
      data: {id: id},
      success:function(msg){
        if(msg == 1){
           window.location.href='';
        }else{
          alert('删除失败。请重试');
        }
      }
    })
	}
}

//全选
$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})

//批量删除
function DelSelect(){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		var t=confirm("您确认要删除选中的内容吗？");
		if (t==false) return false;		
		$("#listform").submit();		
	}
	else{
		alert("请选择您要删除的内容!");
		return false;
	}
}

//批量排序
function sorts(){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){	
		
		$("#listform").submit();		
	}
	else{
		alert("请选择要操作的内容!");
		return false;
	}
}


//批量首页显示
function changeishome(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");		
	
		return false;
	}
}

//批量推荐
function changeisvouch(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");	
		
		return false;
	}
}

//批量置顶
function changeistop(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){		
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");		
	
		return false;
	}
}


//批量移动
function changecate(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){		
		
		$("#listform").submit();		
	}
	else{
		alert("请选择要操作的内容!");
		
		return false;
	}
}

//批量复制
function changecopy(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){	
		var i = 0;
	    $("input[name='id[]']").each(function(){
	  		if (this.checked==true) {
				i++;
			}		
	    });
		if(i>1){ 
	    	alert("只能选择一条信息!");
			$(o).find("option:first").prop("selected","selected");
		}else{
		
			$("#listform").submit();		
		}	
	}
	else{
		alert("请选择要复制的内容!");
		$(o).find("option:first").prop("selected","selected");
		return false;
	}
}

</script>
</body>
</html>